<?php
if (!defined('BASEPATH')) exit('No direct script access allowed');

class Geo_model extends Base_Model{
    
    function __construct() {
        parent::__construct();
    }

    public function get_by_id($id){
    	if($id){
    		$sql = "SELECT * FROM geo WHERE id=$id";
    		$arr_rs = $this->db->query($sql)->row_array();
    		return $arr_rs;
    	}else{
    		return FALSE;
    	}
    }
    
    public function get_by_parent_id($parent_id=0){
	$sql = "SELECT * FROM geo WHERE parent_id=$parent_id";
	$arr_rs = $this->db->query($sql)->result_array();
	return $arr_rs;
    }
    
    
}

